// 
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import {  presetAttributify, presetIcons, presetUno } from 'unocss'
import Unocss from '@unocss/vite'


// 配置路径别名
const resolve = (dir: string) => path.resolve(__dirname, dir)

export default defineConfig({
  plugins: [
    vue(),
    Unocss({
      presets: [
        presetUno(),
        presetAttributify(),
        presetIcons({
          scale: 1.2,
          warn: true,
          extraProperties: {
            'display': 'inline-block',
            'vertical-align': 'middle',
          },
        })
      ],
      theme: {
        colors: {
          primary: '#0092f7',
          secondary: '#4cb6ff',
          dark: '#1d1d1d',
          light: '#f5f5f5',
          gray: {
            50: '#fafafa',
            100: '#f5f5f5',
            200: '#eeeeee',
            300: '#e0e0e0',
            400: '#bdbdbd',
            500: '#9e9e9e',
            600: '#757575',
            700: '#616161',
            800: '#424242',
            900: '#212121',
          },
          danger: '#ff5252',
          success: '#35b900',
          warning: '#ffc107'
        }
      },
    }),
  ],
  resolve: {
    alias: {
      '@': resolve('src')
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "@/styles/base.css";`
      }
    }
  }
})
